package com.langyue.lintcode.entity;

import java.io.Serializable;

public class User implements Serializable,Cloneable {
    private static final long serialVersionUID = 7001775592254294624L;
    public static User user = new User();

    private String username;
    private String password;

    /**
     * 调用对象创建优化
     *
     * @return
     */
    public static User getInstance(){
        try {
            return (User) user.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return new User();
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
